package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 论坛表
 * </p>
 *
 * @author zjn
 * @since 2021-11-10
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("o_conference")
@ApiModel(value = "Conference", description = "论坛表")
@AllArgsConstructor
public class Conference extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 论坛名称
     */
    @ApiModelProperty(value = "论坛名称")
    @Size(max = 32, message = "论坛名称长度不能超过32")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "论坛名称")
    private String name;

    /**
     * 论坛英文名称
     */
    @ApiModelProperty(value = "论坛英文名称")
    @Size(max = 32, message = "论坛英文名称长度不能超过32")
    @TableField(value = "en_name", condition = LIKE)
    @Excel(name = "论坛英文名称")
    private String enName;

    /**
     * 论坛地址
     */
    @ApiModelProperty(value = "论坛地址")
    @Size(max = 256, message = "论坛地址长度不能超过256")
    @TableField(value = "address", condition = LIKE)
    @Excel(name = "论坛地址")
    private String address;

    /**
     * 论坛英文地址
     */
    @ApiModelProperty(value = "论坛英文地址")
    @Size(max = 256, message = "论坛英文地址长度不能超过256")
    @TableField(value = "en_address", condition = LIKE)
    @Excel(name = "论坛英文地址")
    private String enAddress;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @TableField(value = "start_time")
    @Excel(name = "开始时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    @TableField(value = "end_time")
    @Excel(name = "结束时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime endTime;

    /**
     * 封面图片
     */
    @ApiModelProperty(value = "封面图片")
    @Size(max = 256, message = "封面图片长度不能超过256")
    @TableField(value = "cover_image_url", condition = LIKE)
    @Excel(name = "封面图片")
    private String coverImageUrl;

    /**
     * 介绍
     */
    @ApiModelProperty(value = "介绍")
    @Size(max = 16777215, message = "介绍长度不能超过16777215")
    @TableField(value = "introduce", condition = LIKE)
    @Excel(name = "介绍")
    private String introduce;

    /**
     * 英文介绍
     */
    @ApiModelProperty(value = "英文介绍")
    @Size(max = 16777215, message = "英文介绍长度不能超过16777215")
    @TableField(value = "en_introduce", condition = LIKE)
    @Excel(name = "英文介绍")
    private String enIntroduce;

    /**
     * 排序方式
     */
    @ApiModelProperty(value = "排序方式")
    @Size(max = 32, message = "排序方式长度不能超过32")
    @TableField(value = "sort_order_type", condition = LIKE)
    @Excel(name = "排序方式")
    private String sortOrderType;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField(value = "sequence")
    @Excel(name = "排序")
    private Integer sequence;

    /**
     * 是否上架
     */
    @ApiModelProperty(value = "是否上架")
    @TableField(value = "is_shelves")
    @Excel(name = "是否上架")
    private Integer isShelves;

    /**
     * 是否公开
     */
    @ApiModelProperty(value = "是否公开")
    @TableField(value = "is_public")
    @Excel(name = "是否公开")
    private Integer isPublic;

    /**
     * 关联直播id
     */
    @ApiModelProperty(value = "关联直播id")
    @TableField(value = "relation_live_id")
    @Excel(name = "关联直播id")
    private Long relationLiveId;

    /**
     * 关联会议id
     */
    @ApiModelProperty(value = "关联会议id")
    @TableField(value = "relation_meeting__id")
    @Excel(name = "关联会议id")
    private Long relationMeetingId;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;


    @Builder
    public Conference(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, String name, String enName, String address, String enAddress, 
                    LocalDateTime startTime, LocalDateTime endTime, String coverImageUrl, String introduce, String enIntroduce, String sortOrderType, 
                    Integer sequence, Integer isShelves, Integer isPublic, Long relationLiveId, Long relationMeetingId, Integer isEnabled, Integer isDeleted) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.name = name;
        this.enName = enName;
        this.address = address;
        this.enAddress = enAddress;
        this.startTime = startTime;
        this.endTime = endTime;
        this.coverImageUrl = coverImageUrl;
        this.introduce = introduce;
        this.enIntroduce = enIntroduce;
        this.sortOrderType = sortOrderType;
        this.sequence = sequence;
        this.isShelves = isShelves;
        this.isPublic = isPublic;
        this.relationLiveId = relationLiveId;
        this.relationMeetingId = relationMeetingId;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
    }

}
